3.108 \(\int \frac{x^2 \left (A+B x^2\right )}{a+b x^2+c x^4} \, dx\)

Optimal. Leaf size=208 \[ -\frac{\left (-\frac{-2 a B c-A b c+b^2 B}{\sqrt{b^2-4 a c}}-A c+b B\right ) \tan ^{-1}\left (\frac{\sqrt{2} \sqrt{c} x}{\sqrt{b-\sqrt{b^2-4 a c}}}\right )}{\sqrt{2} c^{3/2} \sqrt{b-\sqrt{b^2-4 a c}}}-\frac{\left (\frac{-2 a B c-A b c+b^2 B}{\sqrt{b^2-4 a c}}-A c+b B\right ) \tan ^{-1}\left (\frac{\sqrt{2} \sqrt{c} x}{\sqrt{\sqrt{b^2-4 a c}+b}}\right )}{\sqrt{2} c^{3/2} \sqrt{\sqrt{b^2-4 a c}+b}}+\frac{B x}{c} \]

[Out]

(B*x)/c - ((b*B - A*c - (b^2*B - A*b*c - 2*a*B*c)/Sqrt[b^2 - 4*a*c])*ArcTan[(Sqr
t[2]*Sqrt[c]*x)/Sqrt[b - Sqrt[b^2 - 4*a*c]]])/(Sqrt[2]*c^(3/2)*Sqrt[b - Sqrt[b^2
 - 4*a*c]]) - ((b*B - A*c + (b^2*B - A*b*c - 2*a*B*c)/Sqrt[b^2 - 4*a*c])*ArcTan[
(Sqrt[2]*Sqrt[c]*x)/Sqrt[b + Sqrt[b^2 - 4*a*c]]])/(Sqrt[2]*c^(3/2)*Sqrt[b + Sqrt
[b^2 - 4*a*c]])

_______________________________________________________________________________________

Rubi [A]  time = 1.09481, antiderivative size = 208, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 25, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.12 \[ -\frac{\left (-\frac{-2 a B c-A b c+b^2 B}{\sqrt{b^2-4 a c}}-A c+b B\right ) \tan ^{-1}\left (\frac{\sqrt{2} \sqrt{c} x}{\sqrt{b-\sqrt{b^2-4 a c}}}\right )}{\sqrt{2} c^{3/2} \sqrt{b-\sqrt{b^2-4 a c}}}-\frac{\left (\frac{-2 a B c-A b c+b^2 B}{\sqrt{b^2-4 a c}}-A c+b B\right ) \tan ^{-1}\left (\frac{\sqrt{2} \sqrt{c} x}{\sqrt{\sqrt{b^2-4 a c}+b}}\right )}{\sqrt{2} c^{3/2} \sqrt{\sqrt{b^2-4 a c}+b}}+\frac{B x}{c} \]

Antiderivative was successfully verified.

[In]  Int[(x^2*(A + B*x^2))/(a + b*x^2 + c*x^4),x]

[Out]

(B*x)/c - ((b*B - A*c - (b^2*B - A*b*c - 2*a*B*c)/Sqrt[b^2 - 4*a*c])*ArcTan[(Sqr
t[2]*Sqrt[c]*x)/Sqrt[b - Sqrt[b^2 - 4*a*c]]])/(Sqrt[2]*c^(3/2)*Sqrt[b - Sqrt[b^2
 - 4*a*c]]) - ((b*B - A*c + (b^2*B - A*b*c - 2*a*B*c)/Sqrt[b^2 - 4*a*c])*ArcTan[
(Sqrt[2]*Sqrt[c]*x)/Sqrt[b + Sqrt[b^2 - 4*a*c]]])/(Sqrt[2]*c^(3/2)*Sqrt[b + Sqrt
[b^2 - 4*a*c]])

_______________________________________________________________________________________

Rubi in Sympy [A]  time = 67.239, size = 214, normalized size = 1.03 \[ \frac{B x}{c} + \frac{\sqrt{2} \left (2 B a c + b \left (A c - B b\right ) + \left (A c - B b\right ) \sqrt{- 4 a c + b^{2}}\right ) \operatorname{atan}{\left (\frac{\sqrt{2} \sqrt{c} x}{\sqrt{b + \sqrt{- 4 a c + b^{2}}}} \right )}}{2 c^{\frac{3}{2}} \sqrt{b + \sqrt{- 4 a c + b^{2}}} \sqrt{- 4 a c + b^{2}}} - \frac{\sqrt{2} \left (2 B a c + b \left (A c - B b\right ) - \left (A c - B b\right ) \sqrt{- 4 a c + b^{2}}\right ) \operatorname{atan}{\left (\frac{\sqrt{2} \sqrt{c} x}{\sqrt{b - \sqrt{- 4 a c + b^{2}}}} \right )}}{2 c^{\frac{3}{2}} \sqrt{b - \sqrt{- 4 a c + b^{2}}} \sqrt{- 4 a c + b^{2}}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  rubi_integrate(x**2*(B*x**2+A)/(c*x**4+b*x**2+a),x)

[Out]

B*x/c + sqrt(2)*(2*B*a*c + b*(A*c - B*b) + (A*c - B*b)*sqrt(-4*a*c + b**2))*atan
(sqrt(2)*sqrt(c)*x/sqrt(b + sqrt(-4*a*c + b**2)))/(2*c**(3/2)*sqrt(b + sqrt(-4*a
*c + b**2))*sqrt(-4*a*c + b**2)) - sqrt(2)*(2*B*a*c + b*(A*c - B*b) - (A*c - B*b
)*sqrt(-4*a*c + b**2))*atan(sqrt(2)*sqrt(c)*x/sqrt(b - sqrt(-4*a*c + b**2)))/(2*
c**(3/2)*sqrt(b - sqrt(-4*a*c + b**2))*sqrt(-4*a*c + b**2))

_______________________________________________________________________________________

Mathematica [A]  time = 0.310108, size = 251, normalized size = 1.21 \[ -\frac{\left (-A c \sqrt{b^2-4 a c}+b B \sqrt{b^2-4 a c}+2 a B c+A b c+b^2 (-B)\right ) \tan ^{-1}\left (\frac{\sqrt{2} \sqrt{c} x}{\sqrt{b-\sqrt{b^2-4 a c}}}\right )}{\sqrt{2} c^{3/2} \sqrt{b^2-4 a c} \sqrt{b-\sqrt{b^2-4 a c}}}-\frac{\left (-A c \sqrt{b^2-4 a c}+b B \sqrt{b^2-4 a c}-2 a B c-A b c+b^2 B\right ) \tan ^{-1}\left (\frac{\sqrt{2} \sqrt{c} x}{\sqrt{\sqrt{b^2-4 a c}+b}}\right )}{\sqrt{2} c^{3/2} \sqrt{b^2-4 a c} \sqrt{\sqrt{b^2-4 a c}+b}}+\frac{B x}{c} \]

Antiderivative was successfully verified.

[In]  Integrate[(x^2*(A + B*x^2))/(a + b*x^2 + c*x^4),x]

[Out]

(B*x)/c - ((-(b^2*B) + A*b*c + 2*a*B*c + b*B*Sqrt[b^2 - 4*a*c] - A*c*Sqrt[b^2 -
4*a*c])*ArcTan[(Sqrt[2]*Sqrt[c]*x)/Sqrt[b - Sqrt[b^2 - 4*a*c]]])/(Sqrt[2]*c^(3/2
)*Sqrt[b^2 - 4*a*c]*Sqrt[b - Sqrt[b^2 - 4*a*c]]) - ((b^2*B - A*b*c - 2*a*B*c + b
*B*Sqrt[b^2 - 4*a*c] - A*c*Sqrt[b^2 - 4*a*c])*ArcTan[(Sqrt[2]*Sqrt[c]*x)/Sqrt[b
+ Sqrt[b^2 - 4*a*c]]])/(Sqrt[2]*c^(3/2)*Sqrt[b^2 - 4*a*c]*Sqrt[b + Sqrt[b^2 - 4*
a*c]])

_______________________________________________________________________________________

Maple [B]  time = 0.03, size = 560, normalized size = 2.7 \[ \text{result too large to display} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  int(x^2*(B*x^2+A)/(c*x^4+b*x^2+a),x)

[Out]

B*x/c+1/2*2^(1/2)/((b+(-4*a*c+b^2)^(1/2))*c)^(1/2)*arctan(c*x*2^(1/2)/((b+(-4*a*
c+b^2)^(1/2))*c)^(1/2))*A+1/2/(-4*a*c+b^2)^(1/2)*2^(1/2)/((b+(-4*a*c+b^2)^(1/2))
*c)^(1/2)*arctan(c*x*2^(1/2)/((b+(-4*a*c+b^2)^(1/2))*c)^(1/2))*A*b-1/2/c*2^(1/2)
/((b+(-4*a*c+b^2)^(1/2))*c)^(1/2)*arctan(c*x*2^(1/2)/((b+(-4*a*c+b^2)^(1/2))*c)^
(1/2))*b*B+1/(-4*a*c+b^2)^(1/2)*2^(1/2)/((b+(-4*a*c+b^2)^(1/2))*c)^(1/2)*arctan(
c*x*2^(1/2)/((b+(-4*a*c+b^2)^(1/2))*c)^(1/2))*a*B-1/2/c/(-4*a*c+b^2)^(1/2)*2^(1/
2)/((b+(-4*a*c+b^2)^(1/2))*c)^(1/2)*arctan(c*x*2^(1/2)/((b+(-4*a*c+b^2)^(1/2))*c
)^(1/2))*b^2*B-1/2*2^(1/2)/((-b+(-4*a*c+b^2)^(1/2))*c)^(1/2)*arctanh(c*x*2^(1/2)
/((-b+(-4*a*c+b^2)^(1/2))*c)^(1/2))*A+1/2/(-4*a*c+b^2)^(1/2)*2^(1/2)/((-b+(-4*a*
c+b^2)^(1/2))*c)^(1/2)*arctanh(c*x*2^(1/2)/((-b+(-4*a*c+b^2)^(1/2))*c)^(1/2))*A*
b+1/2/c*2^(1/2)/((-b+(-4*a*c+b^2)^(1/2))*c)^(1/2)*arctanh(c*x*2^(1/2)/((-b+(-4*a
*c+b^2)^(1/2))*c)^(1/2))*b*B+1/(-4*a*c+b^2)^(1/2)*2^(1/2)/((-b+(-4*a*c+b^2)^(1/2
))*c)^(1/2)*arctanh(c*x*2^(1/2)/((-b+(-4*a*c+b^2)^(1/2))*c)^(1/2))*a*B-1/2/c/(-4
*a*c+b^2)^(1/2)*2^(1/2)/((-b+(-4*a*c+b^2)^(1/2))*c)^(1/2)*arctanh(c*x*2^(1/2)/((
-b+(-4*a*c+b^2)^(1/2))*c)^(1/2))*b^2*B

_______________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \[ \frac{B x}{c} + \frac{-\int \frac{{\left (B b - A c\right )} x^{2} + B a}{c x^{4} + b x^{2} + a}\,{d x}}{c} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((B*x^2 + A)*x^2/(c*x^4 + b*x^2 + a),x, algorithm="maxima")

[Out]

B*x/c + integrate(-((B*b - A*c)*x^2 + B*a)/(c*x^4 + b*x^2 + a), x)/c

_______________________________________________________________________________________

Fricas [A]  time = 0.454011, size = 3553, normalized size = 17.08 \[ \text{result too large to display} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((B*x^2 + A)*x^2/(c*x^4 + b*x^2 + a),x, algorithm="fricas")

[Out]

1/2*(sqrt(1/2)*c*sqrt(-(B^2*b^3 + (4*A*B*a + A^2*b)*c^2 - (3*B^2*a*b + 2*A*B*b^2
)*c + (b^2*c^3 - 4*a*c^4)*sqrt((B^4*b^4 + A^4*c^4 - 2*(A^2*B^2*a + 2*A^3*B*b)*c^
3 + (B^4*a^2 + 4*A*B^3*a*b + 6*A^2*B^2*b^2)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)*c + (B*b^3*c^3 + 8*A*a*c^5 - 2*(
2*B*a*b + A*b^2)*c^4)*sqrt((B^4*b^4 + A^4*c^4 - 2*(A^2*B^2*a + 2*A^3*B*b)*c^3 +
(B^4*a^2 + 4*A*B^3*a*b + 6*A^2*B^2*b^2)*c^2 - 2*(B^4*a*b^2 + 2*A*B^3*b^3)*c)/(b^
2*c^6 - 4*a*c^7)))*sqrt(-(B^2*b^3 + (4*A*B*a + A^2*b)*c^2 - (3*B^2*a*b + 2*A*B*b
^2)*c - (b^2*c^3 - 4*a*c^4)*sqrt((B^4*b^4 + A^4*c^4 - 2*(A^2*B^2*a + 2*A^3*B*b)*
c^3 + (B^4*a^2 + 4*A*B^3*a*b + 6*A^2*B^2*b^2)*c^2 - 2*(B^4*a*b^2 + 2*A*B^3*b^3)*
c)/(b^2*c^6 - 4*a*c^7)))/(b^2*c^3 - 4*a*c^4))) + 2*B*x)/c

_______________________________________________________________________________________

Sympy [A]  time = 32.1715, size = 428, normalized size = 2.06 \[ \frac{B x}{c} + \operatorname{RootSum}{\left (t^{4} \left (256 a^{2} c^{5} - 128 a b^{2} c^{4} + 16 b^{4} c^{3}\right ) + t^{2} \left (- 16 A^{2} a b c^{3} + 4 A^{2} b^{3} c^{2} - 64 A B a^{2} c^{3} + 48 A B a b^{2} c^{2} - 8 A B b^{4} c + 48 B^{2} a^{2} b c^{2} - 28 B^{2} a b^{3} c + 4 B^{2} b^{5}\right ) + A^{4} a c^{2} - 2 A^{3} B a b c + 2 A^{2} B^{2} a^{2} c + A^{2} B^{2} a b^{2} - 2 A B^{3} a^{2} b + B^{4} a^{3}, \left ( t \mapsto t \log{\left (x + \frac{- 64 t^{3} A a c^{5} + 16 t^{3} A b^{2} c^{4} + 32 t^{3} B a b c^{4} - 8 t^{3} B b^{3} c^{3} + 2 t A^{3} b c^{3} + 12 t A^{2} B a c^{3} - 6 t A^{2} B b^{2} c^{2} - 18 t A B^{2} a b c^{2} + 6 t A B^{2} b^{3} c - 4 t B^{3} a^{2} c^{2} + 8 t B^{3} a b^{2} c - 2 t B^{3} b^{4}}{- A^{4} c^{3} + 3 A^{3} B b c^{2} - 3 A^{2} B^{2} b^{2} c + A B^{3} a b c + A B^{3} b^{3} + B^{4} a^{2} c - B^{4} a b^{2}} \right )} \right )\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(x**2*(B*x**2+A)/(c*x**4+b*x**2+a),x)

[Out]

B*x/c + RootSum(_t**4*(256*a**2*c**5 - 128*a*b**2*c**4 + 16*b**4*c**3) + _t**2*(
-16*A**2*a*b*c**3 + 4*A**2*b**3*c**2 - 64*A*B*a**2*c**3 + 48*A*B*a*b**2*c**2 - 8
*A*B*b**4*c + 48*B**2*a**2*b*c**2 - 28*B**2*a*b**3*c + 4*B**2*b**5) + A**4*a*c**
2 - 2*A**3*B*a*b*c + 2*A**2*B**2*a**2*c + A**2*B**2*a*b**2 - 2*A*B**3*a**2*b + B
**4*a**3, Lambda(_t, _t*log(x + (-64*_t**3*A*a*c**5 + 16*_t**3*A*b**2*c**4 + 32*
_t**3*B*a*b*c**4 - 8*_t**3*B*b**3*c**3 + 2*_t*A**3*b*c**3 + 12*_t*A**2*B*a*c**3
- 6*_t*A**2*B*b**2*c**2 - 18*_t*A*B**2*a*b*c**2 + 6*_t*A*B**2*b**3*c - 4*_t*B**3
*a**2*c**2 + 8*_t*B**3*a*b**2*c - 2*_t*B**3*b**4)/(-A**4*c**3 + 3*A**3*B*b*c**2
- 3*A**2*B**2*b**2*c + A*B**3*a*b*c + A*B**3*b**3 + B**4*a**2*c - B**4*a*b**2)))
)

_______________________________________________________________________________________

GIAC/XCAS [A]  time = 1.20981, size = 1, normalized size = 0. \[ \mathit{Done} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((B*x^2 + A)*x^2/(c*x^4 + b*x^2 + a),x, algorithm="giac")

[Out]

Done